const app = getApp();
var config = app.globalData.config;
const http = require('../../utils/http.js');
Page({
	data: {
		eid_active: 1,
		sid_active: 0,
		order_list: [],
		orderType: 0
	},
	onLoad(options) {
		this.orderType = options.type;
		this.sid_active = options.type; //选择类型
		this.setData({
			'orderType': options.type,
			'sid_active': options.type
		});
		this.getOrderList();
	},
	getOrderList() {
		var that = this;
		http.httpPost(config.get_order_list, {
			status: that.sid_active,
			order_type : that.data.eid_active
		}, function(e) {
			that.order_list = e.data;
			that.setData({
				'order_list': e.data
			})

		});
	},
	eid_change(e) { //选择订单类型
		let eid = e.currentTarget.dataset.eid;
		this.setData({
			eid_active: eid
		})
		this.getOrderList();
	},
	sid_change(e) { //选择订单状态
		let sid = e.currentTarget.dataset.sid;
		this.sid_active = e.currentTarget.dataset.sid;
		this.setData({
			"sid_active": sid
		});
		this.getOrderList();
	},
	developmentFun() {
		wx.showToast({
			title: "开发中",
			icon: 'none',
			duration: 1000,
			mask: true
		});
	}


})
